Skip to content

Update customisation options to match the vscode extension #173

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 21, 2023

Conversation

alanz
Copy link
Contributor

@alanz alanz commented Aug 17, 2023

In particular, add the ability to turn on the new cabal plugin and completion for it.

@alanz alanz requested a review from michaelpj August 17, 2023 21:25
@alanz
Copy link
Contributor Author

alanz commented Aug 17, 2023

I am not able to get this working locally, so probably not a good idea to merge yet.

@michaelpj
Copy link
Collaborator

BTW you want to use the schema produced by haskell-language-server vscode-extension-schema, not the one from vscode-haskell. They add a bunch of options that are actually specific to the vscode extension rather than HLS.

@alanz
Copy link
Contributor Author

alanz commented Aug 18, 2023

And it struck me I need to ensure it actually gets used too.

Where is the best place to document this update process?

@michaelpj
Copy link
Collaborator

And it struck me I need to ensure it actually gets used too.

I believe lsp-defcustom handles this for us.

Where is the best place to document this update process?

Start a CONTRIBUTING.md?

@alanz alanz force-pushed the cabal-support-config branch from 2f5213e to eee4ed7 Compare August 19, 2023 10:23
@alanz
Copy link
Contributor Author

alanz commented Aug 19, 2023

Take two. Turns out if you run the update script with lsp-haskell already active, it only presents settings for the items not already present.

@alanz alanz force-pushed the cabal-support-config branch from eee4ed7 to 29ab21a Compare August 19, 2023 11:42
@alanz
Copy link
Contributor Author

alanz commented Aug 19, 2023

I find it now works, in that it starts up correctly, and the config settings are sent. But for me completions do not work.

[Trace - 12:38:28 pm] Sending notification 'workspace/didChangeConfiguration'.
Params: {
  "settings": {
    "haskell": {
      "formattingProvider": "fourmolu",
      "checkProject": true,
      "maxCompletions": 40,
      "plugin": {
        "importLens": {
          "codeActionsOn": false,
          "codeLensOn": false
        },
        "hlint": {
          "codeActionsOn": true,
          "diagnosticsOn": true
        },
        "eval": {
          "globalOn": true
        },
        "moduleName": {
          "globalOn": true
        },
        "splice": {
          "globalOn": true
        },
        "haddockComments": {
          "globalOn": true
        },
        "class": {
          "globalOn": true
        },
        "retrie": {
          "globalOn": true
        },
        "stan": {
          "globalOn": true
        },
        "tactics": {
          "globalOn": true,
          "config": {
            "auto_gas": 4,
            "max_use_ctor_actions": 5,
            "timeout_duration": 2,
            "proofstate_styling": true
          }
        },
        "pragmas": {
          "codeActionsOn": true,
          "completionsOn": true
        },
        "ghcide-completions": {
          "config": {
            "autoExtendOn": true,
            "snippetsOn": true
          }
        },
        "ghcide-type-lenses": {
          "globalOn": false,
          "config": {
            "mode": "diagnostics"
          }
        },
        "refineImports": {
          "globalOn": false
        },
        "cabal": {
          "codeActionsOn": true,
          "completionOn": true
        },
        "overloaded-record-dot": {
          "globalOn": true
        },
        "pragmas-completion": {
          "globalOn": true
        },
        "pragmas-disable": {
          "globalOn": true
        },
        "pragmas-suggest": {
          "globalOn": true
        }
      }
    }
  }
}

@@ -0,0 +1,33 @@
# Contributing to lsp-haskell
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff, thanks

@@ -47,13 +47,15 @@

(defcustom-lsp lsp-haskell-formatting-provider
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could migrate these to lsp-defcustom while we're at it. Not sure if it's just a rename or what

@michaelpj
Copy link
Collaborator

We should debug what's going on with cabal files. Is the mode definitely activating? Do you see lsp-mode sending messages to HLS when you're in a cabal file?

@michaelpj michaelpj merged commit 4bb4aff into emacs-lsp:master Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants